/*
 * @Description: 使用小程序日志功能来记录异常情况
 * @Author: yangrongxin
 * @Date: 2021-06-11 09:45:11
 * @LastEditors: yangrongxin
 * @LastEditTime: 2021-06-11 09:55:30
 */
import Taro from '@tarojs/taro';

const logger = Taro.canIUse('getRealtimeLogManager') ? Taro.getRealtimeLogManager() : null;

const wxLog = {
  // 记录info提示信息
  info: (str: string) => {
    logger?.info(str);
  },
  error: (str: string) => {
    logger?.error(str);
  },
  warn: (str: string) => {
    logger?.warn(str);
  },
};

export default wxLog;
